package com.codrim.cs.data.server.dao.entity;

import com.codrim.cs.data.rpc.dto.result.WholeDayDataResultDTO;

import lombok.Data;

/**
 *
 * @author Liang.Zhuge
 * @date 05/08/2017
 */
@Data
public class MergeDataRecordDO {
    private String sdates;
    private String offerId;
    private String affiliateId;
    private String advertiserId;
    private Integer customerId;
    private Integer advAdvertiserManagerId;
    private Integer advAffiliateManagerId;
    private Integer affAdvertiserManagerId;


    private String symbol;

    private Long clicks;
    private Long uniqueClicks;
    private Long grossConversions;
    private String scr;
    private Long scrubbedConversions;
    private Long conversions;
    private Float revenue;
    private Float cost;
    private Integer accessType;

    public WholeDayDataResultDTO toWholeDayDataResultDTO() {
        WholeDayDataResultDTO dto = new WholeDayDataResultDTO();
        dto.setSdate(new Integer(this.sdates.replaceAll("-","")));
        dto.setSymbol(this.symbol);
        dto.setClick(this.clicks);
        dto.setUclick(this.uniqueClicks);
        dto.setGc(this.grossConversions);
        dto.setConversion(this.conversions);
        dto.setSc(this.scrubbedConversions);
        dto.setPprice(this.cost);
        dto.setAprice(this.revenue);
        return dto;
    }
}
